<template>
  <div class="school">
    <h2>名称：{{ name }}</h2>
    <h2>地址：{{ age }}</h2>
    <h2>名称：{{ num }}</h2>
    <button @click="sendStudentName">把name给school</button>
  </div>
</template>

<script>
export default {
  name: "student",
  data() {
    return {
      name: "789852",
      age: "456",
      num:0
    };
  },
  methods: {
    sendStudentName(){
      this.$bus.$emit('student', this.name)
    }
  }
  
};
</script>

<style scoped>
.school {
  background-color: greenyellow;
  padding: 5px;
  margin-top: 30px;
}
</style>
